﻿<!DOCTYPE html>
<html lang="en">
<head>
   <title id='Description'>To switch to a right-to-left representation, just enable a single property - "rtl". When this property is on, the layout of jqxGrid's UI elements is reversed.</title>
    <link rel="stylesheet" href="../../jqwidgets/styles/jqx.base.css" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery-1.8.2.min.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxcore.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxdata.js"></script> 
    <script type="text/javascript" src="../../jqwidgets/jqxbuttons.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxscrollbar.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxmenu.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.js"></script>
    <script type="text/javascript" src="../../jqwidgets/jqxgrid.selection.js"></script> 
    <script type="text/javascript" src="../../scripts/gettheme.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            var theme = getDemoTheme();

            var url = "../sampledata/orders.xml";

            // prepare the data
            var source =
            {
                datatype: "xml",
                datafields: [
                    { name: 'ShippedDate', map: 'm\\:properties>d\\:ShippedDate', type: 'date' },
                    { name: 'Freight', map: 'm\\:properties>d\\:Freight', type: 'float' },
                    { name: 'ShipName', map: 'm\\:properties>d\\:ShipName', type: 'string' },
                    { name: 'ShipAddress', map: 'm\\:properties>d\\:ShipAddress', type: 'string' },
                    { name: 'ShipCity', map: 'm\\:properties>d\\:ShipCity', type: 'string' },
                    { name: 'ShipCountry', map: 'm\\:properties>d\\:ShipCountry', type: 'string' }
                ],
                root: "entry",
                record: "content",
                id: 'm\\:properties>d\\:OrderID',
                url: url
            };

            var dataAdapter = new $.jqx.dataAdapter(source);

            // create jqxgrid.
            $("#jqxgrid").jqxGrid(
            {
                width: 670,
                height: 450,
                source: dataAdapter,
                theme: theme,
                rtl: true,
                columns: [
                  { text: 'Ship Name',  datafield: 'ShipName', width: 250, align: 'right', cellsalign: 'right' },
                  { text: 'Shipped Date', datafield: 'ShippedDate', width: 100, align: 'right',  cellsalign: 'right', cellsformat: 'yyyy-MM-dd' },
                  { text: 'Freight', datafield: 'Freight', width: 80, align: 'right',  cellsformat: 'F2', cellsalign: 'right' },
                  { text: 'Ship Address', datafield: 'ShipAddress', align: 'right',  width: 350, cellsalign: 'right' },
                  { text: 'Ship City', datafield: 'ShipCity', width: 100, align: 'right',  cellsalign: 'right' },
                  { text: 'Ship Country', datafield: 'ShipCountry', align: 'right',  cellsalign: 'right' }
                ]
            });
        });
    </script>
</head>
<body class='default'>
      <div id="jqxgrid">
       </div>
</body>
</html>
